var arr = [1, 'a', '1', 2, '2', 'b', 'b', null, null, , , 'null'];
var obj = {};
var result = [];
for (var i = 0; i < arr.length; i++) {
    var key = typeof arr[i] + arr[i];
    console.log(key)
    if (!obj[key]) {
        obj[key] = true;
        result.push(arr[i])
    }
}
console.log(result);
//或者不用多余的数组存储
for (var i = 0; i < arr.length; i++) {
    var key = typeof arr[i] + arr[i];
    if (!obj.hasOwnProperty(key)) {
        obj[key] = arr[i];
    }
} console.log(Object.values(obj));
//es5 for in遍历